import { fromJS } from 'immutable'

export default {
    // 搜索
    setSearch(state, action) {
        // js转为immutable对象
        let data = fromJS(action.payload)
        let newState = state.set('serchStatus', false)
        // 追加数据
        return newState.updateIn(['searchs'], item => item.concat(data))
    },
    //   清空
    clearsearch(state, action) {
        return state.removeAll('searchs')
    },
    //禁用
    disableBtn(state, action) {
        return state.set('serchStatus', true)
    }

}